
// 获取oss图片路径
export function getImagePathByStore(){
  return uni.getStorageSync('imgPath')
}

// 华为云缩略图 2=图片的宽 h=图片的高
export function useThumbnail(url, w=50, h=50) {
  let thumbnailUrl = ''
  if (!(/http.*/.test(url))) {
    thumbnailUrl = `${getImagePathByStore()+url}?x-image-process=image/resize,m_fill,h_${h},w_${w}`
  } else {
    thumbnailUrl = `${url}?x-image-process=image/resize,m_fill,h_${h},w_${w}`
  }
  return thumbnailUrl
}

// 完整路径
export function useFullPath(url) {
  return `${getImagePathByStore()+url}`
}